{include_core file="m/lib/header.html" type="login" title="用户登录" }

<div class="login-box">
  <div class="input-list">
  	<form action = "{AnUrl('user/login/check_login')}" id="btn_login_form" method="post">
    <div class="input-txt">
      <label><input type="text" name="username" id="username" placeholder="用户名/邮箱/手机号"/></label>
      <label><input type="password" name="password" id="password" placeholder="密码"/></label>
    </div>
    <p class="login-want clearfix"><label class="label1"><input type="checkbox" name="memberpass" value="1"/>两周内自动登陆</label><a href="{AnUrl('user/getback/get_back')}" class="forget-pwd">忘记密码</a></p>
    <p><a href="javascript:void(0);" id="btn_login" class="login-btn">立即登录</a></p>
    <p><a href="{AnUrl('user/register')}" class="register-btn">注册NBD账号</a></p>
    <p class="lx-login"><a href="{AnUrl('openapi/lenovo/index')}">联想通行证登录</a></p>
    </form>
  </div>
  <div class="other-login">
    <p class="tit"><span class="middle">合作账号登录</span></p>
    <div class="social">
      <a href="{AnUrl('openapi/sinaweibo/index')}" class="sina"></a>
      <a href="{AnUrl('openapi/qqconnect/login')}" class="qq"></a>
      <a href="{AnUrl('openapi/baiduconnect/login')}" class="baidu"></a>
      {if is_weixin()}
      <a href="{AnUrl('openapi/weixin/index/login')}" class="weixin"></a>
      {/if}
    </div>
  </div>
</div>
<script type="text/javascript">
$(function(){
  $('#btn_login').click(function(){
    var username = $.trim($('#username').val());
    var password = $.trim($('#password').val());
    if(username == '') {
      mobileShowMsg('用户名不能为空');
      return;
    } 
    if(password == '') {
      mobileShowMsg('密码不能为空');
      return;
    }
    
    $.post(
        "{AnUrl('user/login/check_login')}",
        { "username" : username, "password":password },
        function(data){
          if(data.info == 'error') {
            if(data.type == 'user') {
              mobileShowMsg(data.msg);
              return;
            } else {
              mobileShowMsg(data.msg);
              return;
            }
          } else {
            $('#btn_login_form').submit();
          }
        },'json');
    
  });
})
</script>
{include_core file="m/lib/footer.html" type="login" title="用户登录" } 